package com.open.capacity.finance.service.impl;

import com.open.capacity.finance.util.uuid.UUIDUtils;
import com.open.capacity.utils.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.open.capacity.commons.PageResult;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.open.capacity.commons.CodeEnum;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections4.MapUtils;

import com.open.capacity.finance.entity.FileInfo;
import com.open.capacity.finance.dao.FileInfoDao;
import com.open.capacity.finance.service.FileInfoService;


@Service
public class FileInfoServiceImpl implements FileInfoService {

    @Autowired
    private FileInfoDao fileInfoDao;

    /**
     * 添加
     *
     * @param fileInfo
     */
    public int save(FileInfo fileInfo) {
        fileInfo.setId(UUIDUtils.getOriginalUUIDWithoutBar());
        fileInfo.setCreateTime(new Date());
        return fileInfoDao.save(fileInfo);
    }


    /**
     * 删除
     *
     * @param id
     */
    public int delete(String id) {
        return fileInfoDao.delete(id);
    }

    @Override
    public int deleteByIds(List<String> ids) {
        return fileInfoDao.deleteByIds(ids);
    }

    /**
     * 查询记录
     *
     * @param id
     * @return
     */
    public FileInfo findById(String id) {
        return fileInfoDao.findById(id);
    }

    @Override
    public List<FileInfo> findByIds(List<String> ids) {
        return fileInfoDao.findByIds(ids);
    }


}
